package com.story.story_serve.service.Book;

import com.story.story_pojo.Book.BookComment;
import com.story.story_pojo.Book.BookCommentList;
import com.story.story_serve.mapper.Book.BookCommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:  BookCommentService
 * description:
 *
 * @ author:郭海龙
 * @ Create：2024/6/4 13:01
 * @ Version:1.0
 */
@Service
public class BookCommentService {

    @Autowired
    private BookCommentMapper bookCommentMapper;

    // 添加评论
    public String addBComment(BookComment bookComment) {
        int i = bookCommentMapper.insert(bookComment);
        if (i == 0 ){
            return "评论失败";
        }else {
           return "评论成功";
        }
    }


    // 显示评论
    public List<BookCommentList> showBComment(Integer bId) {
        return bookCommentMapper.showBComment(bId);
    }
}
